<template>
<!-- 在模板不需要用this -->
    <div>分类管理{{list}}</div>
</template>
<script>
import getListApi from '@/api/category'
export default {
    name:'Category',//和路由表的name值一致  
    data(){
        return{
            list:[],
            page:{
                current:1,//当前页
                size:20,//每页显示多少条
                total:0//总的记录数
             },
            query:{ },//查询条件

        }
    },
    created() {
        this.fetchData()
    },
    methods: {
        fetchData(){
            getListApi.getList(this.query,this.current,this.size).then(response =>{
                //console.log(response)
                const  resp= response.data
                this.list=resp.records
                this.total=resp.total
            })
        }
    },
}
</script>